package com.welove.util;

import java.util.List;

/**
 * @author dreamfutureba@gmail.com
 * @date 2013-11-4下午11:57:17
 * @version 
 */
public class ValueUtil {
	private static final String TAG=ValueUtil.class.getSimpleName();

	public static boolean isEmpty(Object object) {
		return null == object;
	}
	
	public static boolean isNotEmpty(Object object) {
		return null != object;
	}

	public static boolean isStrEmpty(String value) {
		if (null == value || "".equals(value.trim())) {
			return true;
		} /*
		 * else { // 判断是否全是全角空格 value = value.replaceAll(" ", "").trim(); if
		 * (null == value || "".equals(value.trim())) { return true; } }
		 */
		return false;
	}

	public static boolean isStrNotEmpty(String value) {
		return !isStrEmpty(value);
	}
	
	/**
	 * @param noteList
	 * @return
	 * @Description 判断List是否为空
	 */
	public static boolean isListEmpty(List<?> noteList) {
		return null == noteList || noteList.size() == 0;
	}
	/**
	 * @param noteList
	 * @return
	 * @Description 判断List是否非空
	 */
	public static boolean isListNotEmpty(List<?> noteList) {
		return null != noteList && noteList.size() > 0;
	}
	
	/**
	 * 将boolean true变成"1" false变成"0"
	 * 
	 * @param b
	 * @return
	 */
	public static String bolean2String(boolean b) {
		return b ? "1" : "0";
	}
}
